﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templates/DefaultMaster.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_HomePage_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script>

        var expandInitial = function() {
            var accordian = $get('<%= accordian.ClientID%>');
            if (accordian && accordian.AccordionBehavior) {
                accordian.AccordionBehavior.set_SelectedIndex(0);
                accordian.AccordionBehavior.set_requireOpenedPane(true);
            }
            Sys.Application.remove_load(expandInitial);
        }

        var expandAccordianItem = function(itemIndex) {
            var accordian = $get('<%= accordian.ClientID%>');
            if (accordian && accordian.AccordionBehavior) {
                accordian.AccordionBehavior.set_SelectedIndex(itemIndex);
                var pane = accordian.AccordionBehavior.get_Pane(itemIndex);
                
            }
            return false;
        }

        var attachAccordianExpanded = function() {
            var accordian = $get('<%= accordian.ClientID%>');
            if (accordian && accordian.AccordionBehavior) {
                accordian.AccordionBehavior.add_selectedIndexChanging(accordianExpanded);
            }
        }

        var accordianExpanded = function(sender, e) {
            var img = $get("topicImage");
            if (img) {
                img.src = headerImages[e.get_selectedIndex()].src;
            }
        }

        var headerImages = new Array();
        headerImages[0] = new Image();
        headerImages[0].src = '<%=ResolveUrl("~/img/cocktailHeader1.jpg")%>';
        headerImages[1] = new Image();
        headerImages[1].src = '<%=ResolveUrl("~/img/cocktailHeader2.jpg")%>';
        headerImages[2] = new Image();
        headerImages[2].src = '<%=ResolveUrl("~/img/cocktailHeader3.jpg")%>';
        headerImages[3] = new Image();
        headerImages[3].src = '<%=ResolveUrl("~/img/cocktailHeader4.jpg")%>';

    </script>
    <ajax:Accordion id="accordian" CssClass="topic_accordian" HeaderCssClass="topic_head" HeaderSelectedCssClass="topic_headSelected" ContentCssClass="topic_body" RequireOpenedPane="false" SelectedIndex="-1" runat="server">
        <Panes>
            <ajax:AccordionPane ID="accIntro" runat="server">
                <Header>
                    <h2>Introduction</h2>
                </Header>
                <Content>
                    <div class="article_container">
                        <acms:HtmlContentControlDisplay ID="intro" CssClass="introduction" ControlName="Introduction" runat="server" />
                    </div>
                </Content>
            </ajax:AccordionPane>
            <ajax:AccordionPane ID="accReg" runat="server">
                <Header>
                    <h2>Newsletter Registration</h2>
                </Header>
                <Content>
                    <asp:Panel ID="pnlRegister" CssClass="article_container" runat="server">
                        <acms:HtmlContentControlDisplay ID="newsletterRegistration" ControlName="NewsletterRegistration" runat="server" />
                        <asp:Panel id="pnlNewsletterExecption" CssClass="exception" EnableViewState="false" Visible="false" runat="server">
                            <ul>
                                <asp:ListView ID="dlNewsletterExecption" runat="server">
                                    <LayoutTemplate>
                                        <ul><asp:PlaceHolder id="itemPlaceholder" runat="server" /></ul>
                                    </LayoutTemplate>
                                    <ItemTemplate><li><%#Eval("Message") %></li></ItemTemplate>
                                </asp:ListView>
                            </ul>
                        </asp:Panel>
                        <div style="clear:both;">
                        </div>
                        <ul class="form">
                            <li>
                                <asp:Label ID="Label1" CssClass="formLabel" AssociatedControlID="txtName" Text="Name *" runat="server" />
                                <asp:TextBox ID="txtName" runat="server" />
                                <asp:RequiredFieldValidator ID="valName" ControlToValidate="txtName" ValidationGroup="Newsletter" Display="Dynamic" ErrorMessage="Please Enter Your Name" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="Label2" CssClass="formLabel" AssociatedControlID="txtEmail" Text="Email Address *" runat="server" />
                                <asp:TextBox ID="txtEmail" runat="server" />
                                <asp:RequiredFieldValidator ID="valEmailReq" ControlToValidate="txtEmail" ValidationGroup="Newsletter" Display="Dynamic" ErrorMessage="Please Enter Your Email Address" runat="server"/>
                                <asp:RegularExpressionValidator ID="valEmailFormat" ControlToValidate="txtEmail" ValidationGroup="Newsletter" Display="Dynamic" ErrorMessage="Please Enter a Valid Email Address" runat="server"/>
                            </li>
                            <li>
                                <asp:Label ID="Label3" CssClass="formLabel" AssociatedControlID="txtJob" Text="Job Title" runat="server" />
                                <asp:TextBox ID="txtJob" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="Label4" CssClass="formLabel" AssociatedControlID="txtBar" Text="Bar" runat="server" />
                                <asp:TextBox ID="txtBar" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="Label5" CssClass="formLabel" AssociatedControlID="txtCity" Text="City" runat="server" />
                                <asp:TextBox ID="txtCity" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lbl" CssClass="formLabel" AssociatedControlID="txtCountry" Text="Country" runat="server" />
                                <asp:TextBox ID="txtCountry" runat="server" />
                            </li>
                            <li class="noLabel">
                                <asp:CheckBox ID="cboTC" Text="I have read, understood and agreed to the privacy policy." runat="server" />
                                <acms:CheckedRequiredValidator ID="valTC" ControlsToValidate="cboTC" ValidationGroup="Newsletter" ErrorMessage="<br/>You must agree to the privacy policy." Display="Dynamic" runat="server" />
                            </li>
                            <li class="noLabel">
                                <a href="~/FormPrivacyPolicy.html" runat="server" target="_blank">Privacy Policy</a>
                            </li>
                            <li class="noLabel">
                                <asp:Button ID="btnRegister" Text="Register" ValidationGroup="Newsletter" OnClick="btnRegister_Click" runat="server" />
                            </li>
                        </ul>
                    </asp:Panel>
                    <asp:Panel ID="pnlRegistered" CssClass="article_container" Visible="false" runat="server">
                        <acms:HtmlContentControlDisplay ID="newsletterConfirmation" CssClass="introduction" ControlName="NewsletterConfirmation" runat="server" />
                    </asp:Panel>
                </Content>
            </ajax:AccordionPane>
            <ajax:AccordionPane ID="accNews" runat="server">
                <Header>
                    <h2>News</h2>
                </Header>
                <Content>
                    <acms:AcmsDataList ID="dlNews" SelectedIndex="0" DataSourceID="dsNewsletter" runat="server">
                        <SelectedItemStyle CssClass="article_container" />
                        <SelectedItemTemplate>
                            <acms:SubTemplateLoader ID="subSelected" TemplateFileName="ListSelected" runat="server" />
                        </SelectedItemTemplate>
                        <ItemStyle CssClass="article_container_off" />
                        <ItemTemplate>
                            <acms:SubTemplateLoader ID="subList" TemplateFileName="List" runat="server" />
                        </ItemTemplate>
                        <NoDataTemplate>
                            This is not currently an issue.
                        </NoDataTemplate>
                    </acms:AcmsDataList>
                </Content>
            </ajax:AccordionPane>
            <ajax:AccordionPane ID="accMore" runat="server">
                <Header>
                   <h2>Find Out More</h2>
                </Header>
                <Content>
                    <div class="article_container">
                        <h3>Select Your Country</h3>
                        <p>Select your country name to register your interest and find out more detail about your country’s programme.</p>
                        <asp:DropDownList ID="dlCountries" DataSourceID="dsCountries" DataTextField="DisplayName" AppendDataBoundItems="true" DataValueField="Id" OnSelectedIndexChanged="dlCountries_SelectedIndexChanged" AutoPostBack="true" runat="server">
                            <asp:ListItem Text="Select your country" Selected="True"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div id="faqSelected" class="article_container" visible="false" runat="server">
                        <h3>Frequently Asked Questions and Terms And Conditions</h3>
                        <%--<p><asp:HyperLink ID="lnkTC" target="_blank" Text="Click here" runat="server" /> to see the Terms and Conditions</p>--%>
                        <acms:AcmsDataList ID="dlFAQ" OnItemDataBound="dlFAQ_ItemDataBound" DataSourceID="dsFaqs" SelectedIndex="0" UseAjax="false" runat="server">
                            <SelectedItemTemplate>
                                <div class="question">        
                                    <acms:SubTemplateLoader ID="question"  TemplateFileName="Question" runat="server"/>
                                </div>
                                <div class="answer">
                                    <acms:SubTemplateLoader ID="answer" TemplateFileName="Answer" runat="server"/>
                                </div>
                            </SelectedItemTemplate>
                            <ItemTemplate>
                                <div onclick='__doPostBack("<%#Container.UniqueID %>", "Select");'>
                                    <acms:SubTemplateLoader ID="question" CssClass="questionOff" TemplateFileName="Question" runat="server"/>
                                </div>
                            </ItemTemplate>
                        </acms:AcmsDataList>
                    </div>
                    <div id="regCompSelected" visible="false" class="article_container" runat="server">
                        <h3>Register Your Interest</h3>
                        <acms:HtmlContentControlDisplay ID="worldClassRegistration" ControlName="WorldClassRegistration" runat="server" />
                        <asp:Panel ID="pnlRegisterComp" runat="server">
                            <asp:Panel id="pnlCompExecption" CssClass="exception" EnableViewState="false" Visible="false" runat="server">
                                <ul>
                                    <asp:ListView ID="dlCompExecption" runat="server">
                                        <LayoutTemplate>
                                            <ul><asp:PlaceHolder id="itemPlaceholder" runat="server" /></ul>
                                        </LayoutTemplate>
                                        <ItemTemplate><li><%#Eval("Message") %></li></ItemTemplate>
                                    </asp:ListView>
                                </ul>
                            </asp:Panel>
                            <div style="clear:both;">
                            </div>
                            <ul class="form">
                                <li>
                                    <asp:Label ID="Label6" CssClass="formLabel" AssociatedControlID="txtCompName" Text="Name *" runat="server" />
                                    <asp:TextBox ID="txtCompName" runat="server" />
                                    <asp:RequiredFieldValidator ID="valCompName" ControlToValidate="txtCompName" ValidationGroup="Comp" Display="Dynamic" ErrorMessage="Please Enter Your Name" runat="server" />
                                </li>
                                <li>
                                    <asp:Label ID="Label7" CssClass="formLabel" AssociatedControlID="txtCompEmail" Text="Email Address *" runat="server" />
                                    <asp:TextBox ID="txtCompEmail" runat="server" />
                                    <asp:RequiredFieldValidator ID="valCompEmail" ControlToValidate="txtCompEmail" ValidationGroup="Comp" Display="Dynamic" ErrorMessage="Please Enter Your Email Address" runat="server"/>
                                    <asp:RegularExpressionValidator ID="valCompEmailFormat" ControlToValidate="txtCompEmail" ValidationGroup="Comp" Display="Dynamic" ErrorMessage="Please Enter a Valid Email Address" ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z+])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$" runat="server"/>
                                </li>
                                <li>
                                    <asp:Label ID="Label8" CssClass="formLabel" AssociatedControlID="txtCompJob" Text="Job Title" runat="server" />
                                    <asp:TextBox ID="txtCompJob" runat="server" />
                                </li>
                                <li>
                                    <asp:Label ID="Label9" CssClass="formLabel" AssociatedControlID="txtCompBar" Text="Bar" runat="server" />
                                    <asp:TextBox ID="txtCompBar" runat="server" />
                                </li>
                                <li>
                                    <asp:Label ID="Label10" CssClass="formLabel" AssociatedControlID="txtCompCity" Text="City" runat="server" />
                                    <asp:TextBox ID="txtCompCity" runat="server" />
                                </li>
                                <li>
                                    <asp:Label ID="Label11" CssClass="formLabel" AssociatedControlID="txtCompCountry" Text="Country" runat="server" />
                                    <asp:TextBox ID="txtCompCountry" runat="server" />
                                </li>
                                <li class="noLabel">
                                    <asp:CheckBox ID="cboTCComp" Text="I have read, understood and agreed to the privacy policy." runat="server" />
                                    <acms:CheckedRequiredValidator ID="CheckedRequiredValidator1" ControlsToValidate="cboTCComp" ValidationGroup="Comp" ErrorMessage="<br/>You must agree to the privacy policy." Display="Dynamic" runat="server" />
                                </li>
                                <li class="noLabel">
                                    <a href="~/FormPrivacyPolicy.html" runat="server" target="_blank">Privacy Policy</a>
                                </li>
                                <li class="noLabel">
                                    <asp:Button ID="btnCompRegister" OnClick="btnCompRegister_Click" Text="Register" ValidationGroup="Comp" runat="server" />
                                </li>
                            </ul>
                        </asp:Panel>
                        <asp:Panel ID="pnlRegisteredComp" Visible="false" runat="server">
                            <acms:HtmlContentControlDisplay ID="worldClassConfirmation" CssClass="introduction" ControlName="WorldClassConfirmation" runat="server" />
                        </asp:Panel>
                    </div>
                </Content>
            </ajax:AccordionPane>
        </Panes>
    </ajax:Accordion>
    <telerik:RadAjaxManager ID="ajaxManager" EnableAJAX="true" DefaultLoadingPanelID="loading" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="dlNews">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="dlNews" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="dlFAQ">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="dlFAQ" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="lnkRegCompUnSelected">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="regCompUnSelected" />
                    <telerik:AjaxUpdatedControl ControlID="regCompSelected" />
                    <telerik:AjaxUpdatedControl ControlID="faqUnSelected" />
                    <telerik:AjaxUpdatedControl ControlID="faqSelected" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="lnkFaqUnSelected">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="regCompUnSelected" />
                    <telerik:AjaxUpdatedControl ControlID="regCompSelected" />
                    <telerik:AjaxUpdatedControl ControlID="faqUnSelected" />
                    <telerik:AjaxUpdatedControl ControlID="faqSelected" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="dlCountries">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="regCompUnSelected" />
                    <telerik:AjaxUpdatedControl ControlID="regCompSelected" />
                    <telerik:AjaxUpdatedControl ControlID="faqUnSelected" />
                    <telerik:AjaxUpdatedControl ControlID="faqSelected" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnRegister">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlRegister" />
                    <telerik:AjaxUpdatedControl ControlID="pnlRegistered" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnRegisterComp">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlRegisterComp" />
                    <telerik:AjaxUpdatedControl ControlID="pnlRegisteredComp" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="loading" MinDisplayTime="100" Height="100%" Width="100%" BackColor="White" Transparency="10" runat="server" > 
        <img alt="Loading..."  src='img/loading1.gif' style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
    <acms:PostDataSource ID="dsNewsletter" OnSelectData="dsNewsletter_SelectData" runat="server" />
    <acms:PostDataSource ID="dsCountries" OnSelectData="dsCountries_SelectData" runat="server" />
    <acms:PostDataSource ID="dsFaqs" OnSelectData="dsFaqs_SelectData" runat="server" />
</asp:Content>

